<template>

  <div class="block">
    <el-carousel trigger="click" height="250px">
      <el-carousel-item v-for="img in imgs" :key="img.id">

        <img :src="img.imgSrc" style="width: 100%; height: 100%; object-fit:cover;"/>

      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
    export default {
        name: "lunbo",
        data () {
          return{
            // 用数组存放要轮播的图片
            imgs:[  //数据
              {id:1,imgSrc:require("../../img/轮播图1.jpg")},
              {id:2,imgSrc:require("../../img/轮播图10.png")},
              {id:3,imgSrc:require("../../img/轮播11.png")},
              {id:4,imgSrc:require("../../img/轮播图4.jpg")},
            ],
          }

        }
    }

</script>

<style scoped>
  .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 150px;
    margin: 0;

  }
  el-carousel-item{
    height: 200px;
  }
  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }

  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
</style>
